#ifndef __G_SKELETON_H__
#define __G_SKELETON_H__

#include "skelanim/skeleton.h"
#include "typedefs.h"

/// This class extends the original hierarchical 
/// skeleton definition.
/// It is usefull for performing geometric operations
class GSkeleton : public Skeleton {
   
public:
   GSkeleton();
   GSkeleton(const Skeleton &);
   virtual ~GSkeleton();
   
   /// Returns the segment of i-th bone
   Segment3 getBone(int i) { return boneSegment(i); }
   
   ///
   Vector3 getBoneProjector(const Point3 &p, const int idbone);
   
   ///
   float getDistance(const Point3 &p, const int idbone, float t);
   
   Point3 center() const { return _center; }
   Number radius() const { return _radius; }
   
private:
   void limits();
   
public:
   vector<int>      closest_vertex; // the closest vertex id
   vector<Number>   min_distance_vertex; // the distance to the closest vertex
   vector<bool>     onlyvisible; // o closetvisible bone predomina sobre o 
                                 //  bone mais proximo na metrica que inclui um caminho ao longo da superficie
   
   Point3          _center;
   Number          _radius;
protected:
   
};

#endif
